<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>教师信息管理系统</title>
    <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css">
    <script src="https://www.layuicdn.com/layui-v2.5.6/layui.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://www.layuicdn.com/layer/layer.js"></script>
    <style type="text/css">
        .all {
            position: absolute;
            top: 0px;
            left: 0px;
            right: 0px;
            bottom: 0px;
        }

        .all::-webkit-scrollbar {
            display: none;
        }

        .a::-webkit-scrollbar {
            display: none;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-row">
        <div class="layui-logo">
            <a style="color: white;" href="dashboard">教师信息管理系统</a>
        </div>
        <ul class="layui-nav layui-col-xs-offset10">
            <li class="layui-nav-item"><a href="javascript:;">首页</a></li>
            <li class="layui-nav-item"><a href="javascript:;">欢迎您</a>
                <dl class="layui-nav-child">
                    <dd>
                        <a href="javascript:;">个人信息</a>
                    </dd>
                    <dd>
                        <a id="editt" onclick="edit()" href="javascript:;">修改信息</a>
                    </dd>
                    <dd>
                        <a onclick="exit()" href="javascript:;">退出</a>
                    </dd>
                </dl>
            </li>

        </ul>
    </div>
    <div class="layui-side">
        <ul class="layui-nav layui-nav-tree layui-inline"
            style="height: 100%" lay-filter="side">
            <li class="layui-nav-item layui-this"><a layui-id="1" href="javascript:;">个人信息</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">课程信息</a>
                <dl class="layui-nav-child">
                    <dd><a layui-id="2" href="javascript:;">新建课程</a></dd>
                    <dd><a layui-id="4" href="javascript:;">新建试卷</a></dd>
                    <dd><a layui-id="9" href="javascript:;">新建题库</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">试卷管理</a>
                <dl class="layui-nav-child">
                    <dd><a layui-id="3" href="javascript:;">在线考试</a></dd>
                    <dd><a layui-id="5" href="javascript:;">在线批改</a></dd>
                    <dd><a layui-id="8" href="javascript:;">生成试卷</a></dd>
                </dl>
            </li>
         <!-- <li class="layui-nav-item"><a layui-id="5" href="javascript:;">试卷管理</a></li>-->
          <!--  <li class="layui-nav-item"><a layui-id="8" href="javascript:;">随机组卷</a></li>-->
           <li class="layui-nav-item"><a layui-id="6" href="javascript:;">成绩信息</a></li>
            <li class="layui-nav-item"><a layui-id="7" href="javascript:;">关&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;于</a></li>
        </ul>
    </div>
    <div class="layui-body a">
        <div class="all">
            <iframe id="body" frameborder=”no” border=”0″ marginwidth=”0″ marginheight=”0″ scrolling=”no”
                    allowtransparency=”yes” src="self" height="100%" width="100%"></iframe>
        </div>
    </div>
    <div class="layui-footer">版权所有：蔺培云</div>
</div>
<script>
    layui.use('element', function () {
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        //监听导航点击
        element.on('nav(side)', function (elem) {
            var id = $(this).attr('layui-id');
            if (id == '1') {
                $("#body").attr('src', 'self')//个人信息
            } else if (id == '2') {
                $("#body").attr('src', 'addcourse')//新建课程
            } else if (id == '3') {
                $("#body").attr('src', 'course?page=1&limit=9')//跳转到课程管理页
            } else if (id == '4') {
                $("#body").attr('src', 'paper?page=1&limit=9')//跳转到试卷管理页 PaperController
            } else if (id == '5') {
                $("#body").attr('src', 'answerList?page=1&limit=9')//跳转到判卷管理页
            } else if (id == '6') {
                $("#body").attr('src', 'grade')//跳转到分数页
            } else if (id == '7') {
                $("#body").attr('src', 'about')//跳转到管理页
            } else if (id == '8') {
                $("#body").attr('src', 'asl2')//试卷管理2
            }else if (id == '9') {
                $("#body").attr('src', 'paper2?page=1&limit=9')//试卷管理2
            }

        });
    });

    function exit() {
        $.getJSON('teacher/exit', function (res) {
            if (res.code == "00000") {
                // 清除cookie
                document.cookie = 'username=;expires=-1'
                layer.alert('退出成功');
                window.location.href = 'login.html';
            } else {
                layer.alert(res.message);
            }
        })
    }
    function edit() {
        $("#body").attr('src', 'teacher/edit')
    }
</script>
</body>
</html>
